import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { ParkFaqVO, ParkFaqForm, ParkFaqQuery } from '@/api/park/parkFaq/types';

/**
 * 查询常见问题列表
 * @param query
 * @returns {*}
 */

export const listParkFaq = (query?: ParkFaqQuery): AxiosPromise<ParkFaqVO[]> => {
  return request({
    url: '/park/parkFaq/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询常见问题详细
 * @param faqId
 */
export const getParkFaq = (faqId: string | number): AxiosPromise<ParkFaqVO> => {
  return request({
    url: '/park/parkFaq/' + faqId,
    method: 'get'
  });
};

/**
 * 新增常见问题
 * @param data
 */
export const addParkFaq = (data: ParkFaqForm) => {
  return request({
    url: '/park/parkFaq',
    method: 'post',
    data: data
  });
};

/**
 * 修改常见问题
 * @param data
 */
export const updateParkFaq = (data: ParkFaqForm) => {
  return request({
    url: '/park/parkFaq',
    method: 'put',
    data: data
  });
};

/**
 * 删除常见问题
 * @param faqId
 */
export const delParkFaq = (faqId: string | number | Array<string | number>) => {
  return request({
    url: '/park/parkFaq/' + faqId,
    method: 'delete'
  });
};
